import pymysql
db =pymysql.connect(
    host="localhost",
    port=3306,
    user="root",
    password="748wxc946",
    charset="utf8"
)
cursor =db.cursor()
cursor.execute("select version")
print(cursor)
data =cursor.fetchone()
print(data)
cursor.close()
db.close()
